platform :ios, '13.0'
inhibit_all_warnings!
use_modular_headers!
#use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
install! 'cocoapods', :disable_input_output_paths => true

target 'iOSSwiftTest' do
  
  # 网络请求
  pod 'Alamofire'
  # toast
  pod 'Loaf'
  # animation
  pod 'lottie-ios'
  pod 'EasyAnimation' # 备选
  pod 'Sica' # 核心动画，备选
  # JSON
  pod 'HandyJSON', '~> 5.0.2'
  # UserDefault
#  https://github.com/sindresorhus/Defaults #备选，没pod
  # Date
  pod 'AnyDate'
  # https://github.com/melvitax/DateHelper.git 这个才是需要的，但没pod
  # 下面这几个时间库比较有趣，可以学习一下
  # https://github.com/hemangshah/Datify
  # https://github.com/SwiftKitz/Datez
  # https://github.com/naoty/Timepiece
  # 写个date库可以作为熟悉swift特性的过程
  # 依赖注入
  pod 'WeaverDI'
  # Device Info
#  https://github.com/devicekit/DeviceKit
  # 响应式
  pod 'Bond' # 备选，swift4
  pod 'RxSwift', '6.8.0' # 下面这两个是一体的
  pod 'RxCocoa', '6.8.0'
  # 定位
#  https://github.com/malcommac/SwiftLocation.git # 没有pod
  # 照片选择、处理和下载
  pod 'FMPhotoPicker'
  pod 'Kingfisher', '~> 8.0'
  # 键盘
  pod 'IQKeyboardManagerSwift'
  # 布局框架
  pod 'TangramKit'
  # log
  pod 'XCGLogger', '~> 7.1.5' # 功能强大，但不能显示在app中
  # keychain
  pod 'KeychainSwift'
  # markdown
  pod "MarkdownKit"
  # toast
  pod 'Dodo'
  # loading
  pod 'NVActivityIndicatorView'
  
  # Firebase
  pod 'Firebase/Messaging'
  pod 'FirebaseCore'
  pod 'Firebase/Auth'
  pod 'GoogleSignIn'
  pod 'FirebaseAnalytics'
  pod 'FirebaseCrashlytics'
  
  
#  
#  pod 'TTTAttributedLabel'
#  pod 'Reachability'
#  pod 'PFAudioLib'
#  pod 'SDWebImage'
#  pod 'OpenSSL-Universal'
#  pod 'lottie-ios', '2.5.3'
#  pod 'WCDB.objc'
#  pod 'MyLayout'
#  pod 'ReactiveObjC'
#  pod 'SVProgressHUD'
#  pod 'MJRefresh'
#  pod 'UITableView+FDTemplateLayoutCell'
#  pod 'ZLPhotoBrowser-objc'
#  pod 'SDCycleScrollView'
#  pod 'UICKeyChainStore'
#  pod 'SFImageMaker'
#  pod "GCDWebServer", "~> 3.0"
#  pod 'TABAnimated'
#  pod "MarkdownKit"
#  
#  # YY系列
#  pod 'YYModel'
#  pod 'YYWebImage'
#  pod 'YYImage/WebP'
#  
#  pod 'CocoaLumberjack'
#  pod 'LumberjackConsole'
  
end

pre_install do |installer|
  # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
        xcconfig_path = config.base_configuration_reference.real_path
        IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
      end
    end
  end
  installer.aggregate_targets.each do |target|
    target.xcconfigs.each do |variant, xcconfig|
      xcconfig_path = target.client_root + target.xcconfig_relative_path(variant)
      IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
    end
  end
end

# 连接不上时，挂vpn，并执行 export ALL_PROXY=socks5://127.0.0.1:1086
